import com.sun.org.apache.bcel.internal.generic.IF_ACMPEQ;

import java.util.*;

class Peron{
    String id;
    public Peron(String str){
        this.id = str;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Peron peron = (Peron) o;
        return Objects.equals(id, peron.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
public class Test2 {
    public static void removeRepeat(int[] arr){
        HashSet<Integer> set = new HashSet<>();
        for (int a:arr) {
            set.add(a);
        }
        System.out.println(set);
    }
    public static void firstFirst(int[] arr){
        HashMap<Integer,Integer> hashMap = new HashMap<>();
        for (Integer a:arr) {
            hashMap.put(a,hashMap.getOrDefault(a,0)+1);
        }
        for (Integer b:arr) {
            if (hashMap.get(b) == 1){
                System.out.println(b + " = " + hashMap.get(b));
                return;
            }
        }
    }
    public static void everySize(int[] arr){
        HashMap<Integer,Integer> hashMap = new HashMap<>();
        for (Integer a:arr) {
            hashMap.put(a,hashMap.getOrDefault(a,0)+1);
        }
        System.out.println(hashMap);
    }
    public static void maxSize(int[] arr){
        HashMap<Integer,Integer> hashMap = new HashMap<>();
        for (Integer a:arr) {
            hashMap.put(a,hashMap.getOrDefault(a,0)+1);
        }
        Integer b = arr[0];
        for (Integer a:arr) {
            if (hashMap.get(a) > hashMap.get(b)){
                b = a;
            }
        }
        System.out.println(b + " = " + hashMap.get(b));
    }
    public static void main(String[] args) {
        int[] arr = new int[100];
        Random random = new Random();
        for (int i = 0; i < arr.length; i++) {
            arr[i] = random.nextInt(100);
        }
        //removeRepeat(arr);
        firstFirst(arr);
        maxSize(arr);
        everySize(arr);
    }

    public static void main1(String[] args) {
        Peron peron1 = new Peron("1234");
        Peron peron2 = new Peron("1234");
        int p1 = peron1.hashCode();
        int p2 = peron2.hashCode();
        System.out.println(p1);
        System.out.println(p2);
    }
}
